Skip to content

Expose CodeCoverageTracker on IAccessTestSuite - #97

Merged
josef-poetzl merged 1 commit into
devfrom
feature/codecoverage-tracker-suite
Nov 17, 2026
Merged

josef-poetzl merged 1 commit into
devfrom
feature/codecoverage-tracker-suite

Conversation

@josef-poetzl

Copy link
Copy Markdown
Member

Problem

The generated AccUnit_Factory.CodeCoverageTest contains Set CodeCoverageTestSuite.CodeCoverageTracker = m_CodeCoverageTracker.

  • VBE add-in: runtime error 438, because ITestSuite.CodeCoverageTracker is ComVisible(false) and missing in IAccessTestSuite.
  • Access add-in: no error, but the wrapper TestSuite.cls stored the tracker only privately, so the .NET suite passed Nothing to TestTraceMessage and DebugPrintTestResultReporter never printed the coverage report.

The suite needs the tracker only for the TestTraceMessage event argument (report output); the coverage itself is measured by the tracker.

Change

  • IAccessTestSuite: new COM-visible member CodeCoverageTracker { get; set; } (added last, vtable order of existing members unchanged); Interop.AccessTestSuite forwards it to VBATestSuite.CodeCoverageTracker.
  • access-add-in wrapper TestSuite.cls: passes the tracker to the .NET suite and implements the new interface member.
  • New tests AccessTestSuiteCodeCoverageTrackerTests (event receives tracker, default null, COM visibility).

Compatibility

The interface gets a new member. The Access add-in wrapper must be built together with the new AccUnit.tlb; an old wrapper does not compile against the new typelib.

Tested

  • MSBuild (VS 18) build and the 3 new unit tests: passed.
  • Manual with real Access (managed, no COM registration): tracker arrives in TestTraceMessage, GetReport() returns the report.
  • Manual VBE add-in: CodeCoverageTest(...).AddByClassName(...).Run.CodeCoverageTracker.GetReport works, no error 438.
  • Manual Access add-in: works.

Not changed (found on the way)

  • CodeCoverageTracker.Clear() without argument throws NullReferenceException.
  • VBE add-in TestSuiteManager.InitTestSuite silently returns null after exceptions.
  • VBE logger reporters do not print the coverage report.

@josef-poetzl
josef-poetzl merged commit 5f9f21c into dev Nov 17, 2026
1 check passed
@josef-poetzl
josef-poetzl deleted the feature/codecoverage-tracker-suite branch November 17, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant